$(function(){
	
	var vm = new Vue({
		el:'#Main',
		data:{
			userName:'',
			phone:'',
			sex:null,
			birth:null
		},
		methods:{
			//选择性别
			setSex:function(){
				var that = this;
				var arr = ['先生','女士'];
				dmSelect(arr,function(val){
					that.sex = val;
				});
			},
			//选择生日
			setBirth:function(e){
				var that = this;
				var val = e.currentTarget.value;
				val == '' ? val=null : val;
				that.birth = val;
			},
			//提交
			submit:function(){
				var that = this;
				if(that.userName == ''){
					dmAlert('请输入您的姓名',{
						type:1,
						enter:'我知道了'
					});
					return false;
				};
				
				if(that.phone == ''){
					dmAlert('请输入手机号',{
						type:1,
						enter:'我知道了'
					});
					return false;
				};
				
				if(that.sex == null){
					dmAlert('请选择您的称呼',{
						type:1,
						enter:'我知道了'
					});
					return false;
				};
				
				if(that.birth == null){
					dmAlert('请选择您的出生年月',{
						type:1,
						enter:'我知道了'
					});
					
					return false;
				};
				
				//一切畅通无阻后，提交
				location.href = 'personal_vip2.html';
			}
		},
		mounted:function(){
			pullSwiper('#Main');
		}
	});
	
});
